package GibUI.GameScreen
{
	import mx.containers.Canvas;
	import DramCore.Actor;
	import DramCore.PlaceLayer;
	import DramCore.Place;
	
	public class GibActionLayerAS extends Canvas
	{
		import mx.core.Application;
		
		public function GibActionLayerAS()
		{
			super();
			trace("ActionLayerAS constructor");
		}
		internal function enterActor(newActor:Actor, x:Number, y:Number, z:Number):void {
			try{
			 	this.getChildIndex( newActor );
			} catch( e:Error ){
				// Add child if it doesn't exist here
				this.addChild(newActor);
			}
			newActor.x = x;
			newActor.y = y;
			newActor.visible = true;
		}
		internal function goPlace( place:Place ):void{
			this.removeAllChildren();
			// Put new Place on top
			this.addChild( place );
		}
/*

Got this off sinocular. Sort on z instead. Cuel
var sortedItems:Array = new Array(mc1, mc2, mc3);
Also dig the groovy while-as-for loop
function arrange():void {
    sortedItems.sortOn("y", Array.NUMERIC);
    var i:int = sortedItems.length;
    while(i--){
        if (getChildAt(i) != sortedItems[i]) {
            setChildIndex(sortedItems[i], i);
        }
    }
}

*/
		
	}
}